
#ifndef ICOMPARABLE_H
#define ICOMPARABLE_H

// Riccsson includes.
#include <Typedef.h>
#include <Defines.h>
#include "System/Object.h"

namespace Riccsson
{
	namespace System
	{
		// Forward declerations.
		class Object;

		// Summary:
		//     Defines a generalized type-specific comparison method that a value type or
		//     class implements to order or sort its instances.
		interface IComparable
		{
			// Summary:
			//     Compares the current instance with another object of the same type and returns
			//     an integer that indicates whether the current instance precedes, follows,
			//     or occurs in the same position in the sort order as the other object.
			//
			// Parameters:
			//   obj:
			//     An object to compare with this instance.
			//
			// Returns:
			//     A value that indicates the relative order of the objects being compared.
			//     The return value has these meanings: Value Meaning Less than zero This instance
			//     is less than obj. Zero This instance is equal to obj. Greater than zero This
			//     instance is greater than obj.
			//
			// Exceptions:
			//   System.ArgumentException:
			//     obj is not the same type as this instance.
			public: virtual int CompareTo(Object* obj) = 0;

			public: int CompareTo(const Object* other) const
			{
				return const_cast<IComparable*>(this)->CompareTo(other);
			}
		};
	}
}

#endif // ICOMPARABLE_H